<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="robots" content="index, follow" />
		<meta name="description"
			content="DADF Examples - Home Page" />
		<meta name="keywords" content="DADF Examples, DADF, Database, viewer" />
		<title>
			DADF SERVER 1.2	uses REST services exclusively
		</title>
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
		<script src="/_js/examples.js"></script>
	</head>
	<body>
		<h1>DADF SERVER 1.2 PEER TO PEER SERVER EXAMPLES</h1>
		<p>To view DADF requests in the database use the <a href="/database/">Database to XML viewer here</a></p>
		<p>To POST or PUT more DADF requests to this localhost server instance use the <a href="/resttest">DADF REST Services Examples</a></p>
		
		<div>
			<h3>REST POST/PUT DADF REQUEST</h3>
			<form id="p2p-dadf-host-selector">
				<div>
					<input type="radio" name="rh" onclick="populateDadfHost('server12.dadf.org');" checked="checked" value="server12.dadf.org" /> server12.dadf.org
					<input type="radio" name="rh" onclick="populateDadfHost('dadfserver.com');" value="dadfserver.com" /> dadfserver.com
					<input type="radio" name="rh" onclick="populateDadfHost('localhost');" value="localhost" /> localhost
					<input type="radio" name="rh" onclick="populateDadfHost('');" value="custom" /> custom
					<br /><br />
					<strong>REMOTE DADF SERVER:</strong> <input id="remote-dadf-server" type="text" size="40" name="type" value="http://server.dadf.org" />
				</div>
			</form>
		</div>
		<?php $dadf_version = Zend_Registry::get('application.version'); ?>
		<div>
			<h3>REST POST/PUT DADF REQUEST</h3>
			<form id="sellside-dadf-request" action="/sellside/dadfrequest/" onsubmit="setRemoteHost('sellside-dadf-request');" method="POST" target="_blank">
				<input type="hidden" name="remotehost" value="http://server12.dadf.org" />
				<div>
					<textarea name="xml" cols="140" rows="25"><?php echo file_get_contents('../application/samples/Dadf.request-' . $dadf_version . '.xml'); ?></textarea>
				</div>
				<div>
					<input type="submit" value="POST DADF-REQUEST TO REMOTE HOST" />
				</div>
			</form>
		</div>
	
		<div style="margin-top: 50px;">
			<h3>REST POST/PUT DADF OFFER RESPONSE</h3>
			<p>dadf-offer responses are not inputted through the REST services. They the are HTTP responses to dadf-request's.</p>
		</div>
		
		<div style="margin-top: 50px;">
			<h3>REST POST/PUT DADF ACCEPT RESPONSE</h3>
			<form id="sellside-dadf-accept" action="/sellside/dadfaccept/" onsubmit="setRemoteHost('sellside-dadf-accept');" method="POST" target="_blank">
				<input type="hidden" name="remotehost" value="http://server.dadf.org" />
				<div>
					<textarea name="xml" cols="140" rows="15"><?php echo file_get_contents('../application/samples/Dadf.accept-' . $dadf_version . '.xml'); ?></textarea>
				</div>
				<div>
					<input type="submit" value="POST DADF-ACCEPT TO REMOTE HOST" />
				</div>
			</form>
		</div>
		
		<div style="margin-top: 50px;">
			<h3>REST POST/PUT DADF ACCEPTED RESPONSE</h3>
			<p>dadf-accepted responses are not inputted through the REST services. They the are HTTP responses to dadf-accept's.</p>
		</div>
	
	</body>
</html>




